package com.niiwoo.civet.trade.dao.mapper;

import com.niiwoo.civet.trade.dao.entity.RefundOrderDetail;
import com.niiwoo.civet.trade.dto.RefundOrderTradeSourcePeriodDTO;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * Created by dell on 2018/4/26.
 */
public interface RefundOrderDetailMapperExt extends RefundOrderDetailMapper {


    /**
     * 还款订单请求流水号查询分帐详情

     * @param refundOrderId
     * @return
     */
    List<RefundOrderDetail> selectByOrderIdNotDisable(@Param("refundOrderId") Long refundOrderId);

    /**
     * 记账补单结果集
     * @return
     */
    List<RefundOrderDetail> listForAccouting();


    /**
     * 根据明细存管流水号查询订单明细
     * @param detailRequestNo
     * @return
     */
    RefundOrderDetail queryRefundOrderDetailByDetailRequestNoForUpdate(@Param("detailRequestNo") String detailRequestNo);


    /**
     * 银行放款结果查询任务
     * @return
     */
    List<RefundOrderDetail> queryRefundOrderDetailByBankRefundResultQueryJob();

	/**
	 * 获取每一期的还款来源
	 * 
	 * @param projectId
	 * @return
	 */
	List<RefundOrderTradeSourcePeriodDTO> listRefundOrderDetailByProjectId(@Param("projectId") Long projectId);

    /**
     * 查询是处理中订单数
     */
    Integer countHandingDetail(@Param("refundOrderId")Long refundOrderId);

    int selectDisabledCount(@Param("refundOrderId")Long refundOrderId);
}

